home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_01
/
1001032b
< prev
next >
Wrap
Text File
|
1991-11-16
|
1KB
|
52 lines
//////////////////////////////////////////////////////
// Source code for the "Payroll List" Class
//
//////////////////////////////////////////////////////
#include "paylist.h"
Boolean PayList::find(char *last)
{
if (Pfm_List::find("Last","==",(void *) last))
{
get(empBuffer);
return(true);
}
return(false);
}
Boolean PayList::find(char *last, char *first)
{
if (DB_Find(table,"Last == %s && First == %s",
last, first))
{
get(empBuffer);
return(true);
}
return(false);
}
void PayList::add(employee &emp)
{
Pfm_List::add();
replace(emp);
}
void PayList::replace(employee &emp)
{
Pfm_List::replace("First",emp.first);
Pfm_List::replace("Last",emp.last);
Pfm_List::replace("Pay",emp.pay_rate);
Pfm_List::replace("Days",emp.days_worked);
empBuffer = emp;
}
void PayList::get(employee &emp)
{
Pfm_List::get("First",emp.first);
Pfm_List::get("Last",emp.last);
Pfm_List::get("Pay",emp.pay_rate);
Pfm_List::get("Days",emp.days_worked);
}